<!DOCTYPE html>
<html>
{include file='/common/_meta'}
<script type="text/javascript">
    $(function () {
        $("#uploadify").uploadify({
            console.log(11);
            //指定swf文件
            'swf': '__plus__/uploadify/uploadify.swf',
            //后台处理的页面
            'uploader': "{:url('arti/upload')}",
            'progressData' : 'speed',
            //按钮显示的文字
            'buttonText': '上传文件',
            //显示的高度和宽度，默认 height 30；width 120
            //'height': 15,
            //'width': 80,
            //
            'buttonClass': 'btn btn-azure',

            //上传文件的类型  默认为所有文件    'All Files'  ;  '*.*'
            //在浏览窗口底部的文件类型下拉菜单中显示的文本
            'fileTypeDesc': 'Image Files',
            //允许上传的文件后缀
            // 'fileTypeExts': '*.gif; *.jpg; *.png',
            // 'cancel': 'uploadfy/uploadify-cancel.png',
            //上传文件页面中，你想要用来作为文件队列的元素的id, 默认为false  自动生成,  不带#
            //'queueID': 'fileQueue',
            //选择文件后自动上传
            // 'auto': true,
            //设置为true将允许多文件上传
            // 'multi': true,
            
            'fileObjName':"$_FILES['ar_thumbnail']",

            'onUploadComplete' : function(file,data,response) {
                alert(data);
                var arimgsrc = "__upload__/" + data;
                var arimg = "<img height='50' src='" + arimgsrc + "'>";
                $('#arimg').html(arimg);

             },
            'onCancel' : function(file) {
                 alert('取消上传');
             }

        });
        $('#uploadify-button').removeAttr('style');
    });

</script>
<body>
	<!-- 头部 -->
{include file='/common/top'}
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
        {include file='/common/left'}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="{:url('Index/index')}">系统</a>
                        </li>
                                            <li>
                            <a href="{:url('arti/lst')}">文章管理</a>
                        </li>
                        <li class="active">添加新文章</li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-header bordered-bottom bordered-blue">
                <span class="widget-caption">添加新文章</span>
            </div>
            <div class="widget-body">
                <div id="horizontal-form">
                    <form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data">


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">上级分类</label>
                            <div class="col-sm-6">
                                <select name="ar_cateid">
                                    {volist name="artilist" id="category"}
                                    <option {if condition="$category['cate_id'] eq $category['cate_pid']"} disabled="disabled" {/if} value="{$category.cate_id}"
                                >
                                    
                                     {if condition="$category['cate_pid'] neq 0"}
                                     |
                                     {/if}
                                     <?php echo str_repeat('-',$category['lever']*5); ?>{$category.cate_name}
                                    </option>
                                    {/volist}
                                </select>
                            </div>
                            <p class="help-block col-sm-4 red">* 必填</p>
                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">文章标题</label>
                            <div class="col-sm-6">
                                <input class="form-control" id="username" placeholder="" name="ar_title" type="text">
                            </div>
                            <p class="help-block col-sm-4 red">* 必填</p>
                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">文章关键词</label>
                            <div class="col-sm-6">
                                <input class="form-control" id="username" placeholder="" name="ar_keywords" type="text">
                            </div>
                            <p class="help-block col-sm-4 red"></p>
                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">文章描述</label>
                            <div class="col-sm-6">
                                <textarea class="form-control" id="username" placeholder="" name="ar_description" type="text"></textarea>
                            </div>
                            <p class="help-block col-sm-4 red"></p>
                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">发布人</label>
                            <div class="col-sm-6">
                                <input class="form-control" id="username" placeholder="" name="ar_autor" type="text">
                            </div>
                            <p class="help-block col-sm-4 red"></p>
                        </div>

                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">电子邮件</label>
                            <div class="col-sm-6">
                                <input class="form-control" id="username" placeholder="" name="ar_email" type="text">
                            </div>

                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">友情链接</label>
                            <div class="col-sm-6">
                                <input class="form-control" id="username" placeholder="" name="ar_linkurl" type="text">
                            </div>

                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">文章图片</label>
                            <div class="col-sm-6">
                                <label for="">
                                    <span id="uploadify"></span>
                                    <span class="text"></span>
                                </label>
<!--                                 <input id="uploadify" class="btn-azure" name="ar_thumbnail" type="file">
 -->                            </div>
                        </div>
                        <div id="arimg"></div>
                        


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">内容</label>
                            <div class="col-sm-6">
                                <textarea id="content" name="ar_content" type="text"></textarea>
                            </div>
                            <p class="help-block col-sm-4 red"></p>
                        </div>



                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">是否置顶</label>
                            <div class="col-sm-6">
                                <div class="radio" style="float:left; padding-right: 10px;">
                                    <label>
                                        <input class="inverted colored-blue" value="1" name="ar_top" type="radio">
                                        <span class="text">是</span>
                                    </label>
                                </div>
                                <div class="radio" style="float:left">
                                    <label>
                                        <input class="inverted colored-blue" value="0" checked="checked"  name="ar_top" type="radio">
                                        <span class="text">否</span>
                                    </label>
                                </div>
                            </div>
                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">是否显示</label>
                            <div class="col-sm-6">
                                <div class="radio" style="float:left; padding-right: 10px;">
                                    <label>
                                        <input class="inverted colored-blue" value="1" checked="checked" name="ar_status" type="radio">
                                        <span class="text">是</span>
                                    </label>
                                </div>
                                <div class="radio" style="float:left">
                                    <label>
                                        <input class="inverted colored-blue" value="0" name="ar_status" type="radio">
                                        <span class="text">否</span>
                                    </label>
                                </div>
                            </div>
                        </div>


                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label no-padding-right">发布时间</label>
                            <div class="col-sm-6">
                                <input class="form-control" id="username" placeholder="" name="ar_addtime" type="text">
                            </div>

                        </div>
 

                        
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-default">保存信息</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    {include file='/common/footer'}
    

</body></html>